<span class="sr-only">{{ site.data.strings.navigation | default:"Navigation" }}{{ site.data.strings.colon | default:":" }}</span>
<ul>
  {% if site.menu %}
    {% for node in site.menu %}
      {% assign url = node.url | default: node.href %}
      <li>
        <a
          {% if forloop.first %}id="_navigation"{% endif %}
          href="{% include smart-url.txt url=url %}"
          class="sidebar-nav-item{% if page.url contains url %} active{% endif %}"
          {% if node.rel %}rel="{{ node.rel }}"{% endif %}
        >
          {{ node.name | default:node.title }}
        </a>
      </li>
    {% endfor %}
  {% else %}
    {% assign pages = site.pages | where: "menu", true %}
    {% assign documents = site.documents | where: "menu", true %}
    {% assign nodes = pages | concat: documents | sort: "order" %}

    {% for node in nodes %}
      {% unless node.redirect_to %}
        <li>
          <a
            {% if forloop.first %}id="_navigation"{% endif %}
            href="{{ node.url | relative_url }}"
            class="sidebar-nav-item{% if page.url contains node.url %} active{% endif %}"
            {% if node.rel %}rel="{{ node.rel }}"{% endif %}
            >
            {{ node.title }}
          </a>
        </li>
      {% else %}
        <li>
          <a href="{{ node.redirect_to }}" class="sidebar-nav-item external" >{{ node.title }}</a>
        </li>
      {% endunless %}
    {% endfor %}
  {% endif %}
</ul>
